$(function(){
	sidebarPosition();
	$(window).resize(sidebarPosition);
});

function sidebarPosition(){
	var h = $(window).height()-40;
	h = h<300 ? 300 : h;
	var l = $(window).width()-210;
	l = l<800 ? 800 : l;
	
	
	$("#sidebar-left,#sidebar-right,#document").height(h);
	$("#sidebar-right").css("left", l)
}